var eventproxy = require('eventproxy')

var ep = new eventproxy();

ep.on('err', function err(res, status, errmessage) {
    var data = {
        code: status,
        message: errmessage,
        data: null
    }
    res.json(data);
});


ep.on('success', function err(res,data,message) {
    var data = {
        code: 200,
        message: message,
        data: data
    }
    res.json(data);
});

module.exports = ep;